package JAVACORE_TRAINING.OOPs.OOPs_EXCERCISES.LEVER01.EX05;

public class Models {
	/***
	 * 
	 * @param obj
	 * + obj.getMarriage() == 0: Ly hôn
	 *  + obj.getMarriage() == 1: Chưa kết hôn
	 *  + obj.getMarriage() == 2: Đã kết hôn
	 *  + obj.getSex() == 0: Nữ
	 *  + obj.getSex() == 1: Nam
	 *  + obj.getSex() == 2: Ko xác định
	 * @return
	 */
	public boolean CheckElement(PersonObject obj){
		/*if (obj.getAge() < 19 
			|| obj.getMarriage() == 2 
			|| (obj.getAge() < 22 
					&& obj.getSex() == 1)) {
			return false;
		} else {
			return true;
		}*/
		
		return (obj.getAge() < 19 
				|| obj.getMarriage() == 2 
				|| (obj.getAge() < 22 
						&& obj.getSex() == 1)) ? false : true;
	}
}
